import { createApp } from "vue";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import router from "src/manager/router/index";
import store from "src/manager/store/index";
import "@/manager/styles/index.scss"; // global css
import "./permission";


//代码高亮文件引入
import hljs from "highlight.js";
//样式文件,这里我选的是sublime样式，文件里面还有其他样式可供选择
import "highlight.js/styles/atom-one-light.css";

const app = createApp(App);

if(process.env.NODE_ENV === 'pro'){
   console.log = function(){};
}

app.directive("highlight", function (el) {
   const blocks = el.querySelectorAll("pre code");
   blocks.forEach((block) => {
     hljs.highlightBlock(block);
   });
 });

app.use(store);
app.use(router);
app.use(ElementPlus);
app.mount("#app");
